import Vue from 'vue'
import VueRouter from 'vue-router'
import loginView from '../views/loginView.vue'
import home from '../views/homeView.vue'

Vue.use(VueRouter)

const routes = [{
		path: '/',
		name: '登录',
		component: loginView
		// component: home
	},{
		path: '/login',
		name: '登录',
		component: loginView
	},{
		path: '/home',
		name: '首页',
		component: home
	},{
		path: '/reg',
		name: '注册',
		component: () => import('@/views/regView.vue')
	},{
		path: '/findpass',
		name: '找回密码',
		component: () => import('@/views/findpassView.vue')
	},{
		path: '/fun/information',
		name: '消息',
		component: () => import('@/views/fun/information.vue')
	},{
		path: '/fun/order',
		name: '订单',
		component: () => import('@/views/fun/order.vue')
	},{
		path: '/fun/addressbook',
		name: '通讯录',
		component: () => import('@/views/fun/addressBook.vue')
	},{
		path: '/fun/member',
		name: '成员管理',
		component: () => import('@/views/fun/member.vue')
	},{
		path: '/fun/appoint',
		name: '指派管理',
		component: () => import('@/views/fun/appoint.vue')
	},{
		path: '/fun/usermsg',
		name: '个人信息',
		component: () => import('@/views/fun/appoint.vue')
	},{
		path: '/set/usermsg',
		name: '个人信息',
		component: () => import('@/views/set/usemsg.vue')
	},{
		path: '/set/alterpass',
		name: '修改密码',
		component: () => import('@/views/set/alterpass.vue')
	},{
		path: '/set/useragr',
		name: '用户协议',
		component: () => import('@/views/set/useragr.vue')
	},{
		path: '/fun/loginadmin',
		name: '登录管理',
		component: () => import('@/views/set/loginAdmin.vue')
	},{
		path: '/voice',
		name: '语音聊天',
		component: () => import('@/views/voice/voice.vue')
	}
]

const router = new VueRouter({
	mode: 'hash', //history
	scrollBehavior: () => ({ y: 0 }),
	// base: process.env.BASE_URL,
	routes:[...routes]
})

export default router